package com.hqyj.role.controller;


import com.hqyj.role.dto.RoleInfo;
import com.hqyj.role.entity.Role;
import com.hqyj.role.service.RoleService;
import com.hqyj.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sdx2009
 * @since 2022-10-08
 */
@RestController
@RequestMapping("/api/role")
public class RoleController {
    @Autowired
    private RoleService roleService;

    @PostMapping("selectRolePower")
    public ResultUtils SelectRolePower(){
        return roleService.SelectRolePower();
    }

    @PostMapping("queryPowerByRole")
    public ResultUtils queryPowerByRole(RoleInfo roleInfo){
        return roleService.queryPowerByRole(roleInfo);
    }

    @PostMapping("queryAllPower")
    public ResultUtils queryAllPower(){
        return roleService.queryAllPower();
    }

    @PostMapping("updateRole")
    public ResultUtils updateRole(RoleInfo roleInfo){
        return roleService.updateRole(roleInfo);
    }

    @PostMapping("addRole")
    public ResultUtils addRole(RoleInfo roleInfo){
        return roleService.addRole(roleInfo);
    }

    @PostMapping("deleteRole")
    public ResultUtils deleteRole(RoleInfo roleInfo){
        return roleService.deleteRole(roleInfo);
    }
}
